{% extends "lottery/index.html" %}
{% block body %}

<div class="qbkj-cont">
    <h3 class="kaij-tit">{{contacts2.logo}}<em>{{contacts2.link__code}}期</em> <em class="ui-head-r">{{contacts2.date}}</em></h3>
    
    {% for contact in contacts %}
    <div class="kaij-boxer">
<h3>算法{{contact.num}}：{{contact.alg_name}}<input class="input" value="{{contact.a_id}}" type="checkbox"/>
</h3>
<table>
   <tbody>
    <tr style="height: 9px;">
        <td></td>
        <td></td>
    </tr>
    
    {% if contact.orange %}
    <tr>
        <td style="width:26%">前区可能开出：</td>
        <td>
            {% for o in contact.orange %}
            <span style="margin-right: 6px;color: #ed8431;">{{o}}</span>
            {% endfor %}
        </td>
    </tr>
    {% endif %}

    {% if contact.solida %}
    <tr style="height: 9px;">
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td style="width:26%">后区可能开出：</td>
        <td>
            {% for s in contact.solida %}
            <span style="margin-right: 6px;color: #696bc9">{{s}}</span>
            {% endfor %}
        </td>

    </tr>
    {% endif %}

    {% if contact.red %}
    <tr>
        <td style="width:26%">红区可能开出：</td>
        <td>
            {% for r in contact.red %}
            <span style="margin-right: 6px;color: rgba(246,63,63,1);">{{r}}</span>
            {% endfor %}
        </td>
    </tr>
    {% endif %}

    {% if contact.blue %}
    <tr style="height: 9px;">
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td style="width:26%">蓝区可能开出：</td>
        <td>
            {% for b in contact.blue %}
            <span style="margin-right: 6px;color: rgba(80,140,238,1);">{{b}}</span>
            {% endfor %}
        </td>
    </tr>
    {% endif %}
   


   </tbody>
</table>

</div>
{% endfor %}

    <button style="margin-left: 25%;" onclick="get_ai(0)" class="button button2">AI预测中奖号码</button>
    <button style="margin-left: 25%;" onclick="get_ai(1)" class="button button1">随机选号</button>

</div>

<script>
var res = document.cookie.indexOf("first");
if(res!=0){
var oDate =new Date();
document.cookie ="first=first;";
alert("请注意！\r\n1、数据只作参考，切勿迷恋，量力而为，不然受伤的是自己。\r\n2、算法还不够全，期待myyx更新。")
}

function get_ai(num){
let check = document.getElementsByTagName('input');

if (num == 0){
    var c_status = false
for (j = 0,len=check.length; j < len; j++) {
    if (check[j].checked == true){
        c_status = true
    }
}
if (c_status == false){
    alert("请选择算法，才能预测中奖号码！")
} else {
    var p_result = []
for (j = 0,len=check.length; j < len; j++) {
    if (check[j].checked == true){
        p_result.push(check[j].value)
    }
}p_url = '/ai/?l_id={{contacts2.l_id}}&random='+num+'&id='+p_result

window.location.href=p_url
} 

}else {
    var p_result = []
for (j = 0,len=check.length; j < len; j++) {
        p_result.push(check[j].value)
}p_url = '/ai/?lucky=1&l_id={{contacts2.l_id}}&random='+num+'&id='+p_result

window.location.href=p_url
}
}

</script>

{% endblock body %}